Components of Alert Message
Parameters for alert messages are listed below:
TradingView Strategy sample: https://www.tradingview.com/script/CZrGSc7m-test-signal-0303-tvl/
Component | Parameters | Remarks |
---|---|---|
Mandatory | Password for Webhook ID | The password is unique and it can be found in the webhook dashboard. It is a mandatory component in the beginning of alert message. |
Actions | Instructions to be carried out when an alert is triggered. E.g. long, short and flat | |
Symbol | This refers to the ticket or instrument to be traded. E.g. BTCUSD | |
Quantity (q) | The size of an order in lot size. E.g. q=0.1 | |
Optional | Take Profit (tp) | Take profit of the trade, it can be specified by points and price. E.g. for points: tp=300, for price: tpp=2.19 |
Stop Loss (sl) | Stop loss of the trade, it can be specified by points and price. E.g. for points: sl=300, for price: slp=2.19 |
Note: Points refer to the smallest price unit of a currency. Hence, the digits of Points may vary in symbols, depending on the price quotation system used by brokers. It is advisable to test the signals on a demo account before using them in actual trading.
To ensure successful trade execution, it is important to follow the correct syntax for the alert message in the following order:
Password for Webhook ID
(start at next line) Actions Symbol Quantity Others
PasswordTest
long BTCUSD q=0.1 sl=1000
Orders are executed in market orders in default.
Compulsory values – Password for Webhook ID, Action, symbol and quantity
Example:
PasswordTest
long BTCUSD q=0.1
PasswordTest
short BTCUSD q=0.1 sl=800 tp=1000
TradingView strategy:
{{strategy.market_position}} for a strategy with "long", "flat", and "short" command
Example:
PasswordTest
{{strategy.market_position}} BTCUSD q=0.06
By specifying qt=percent, the quantity of lots will be calculated based on the percentage of the account balance. Since the calculation logic may differ among brokers and symbols, it is advisable to test this feature on a demo account of your broker before using this feature in actual trading.
Example which execute trades with 20% of your total account balance:
PasswordTest
{{strategy.market_position}} EURUSD q=10 qt=percent
{{strategy.market_position}} EURUSD q=10 qt=percent
Note: Some brokers may have settings on the maximum lots per trade (e.g. Cannot exceed q=100 per order). You may use the split order feature to pass this rule as shown as the example above.
PasswordTest
{{strategy.order.action}} BTCUSD q=0.06 slp=40000 tp=1000
Orders can be split within the same alert message by inputting each order on a new line.
Example:
PasswordTest
short BTCUSD q=0.1 sl=800 tp=1000
short BTCUSD q=0.2 sl=800 tp=1000
Compulsory values – Password for Webhook ID, action, symbol
Close action command – flat
Note: It will close all open trades for that symbol.
Example:
PasswordTest
flat US500
It will still close all open trades even quantity or take profit / stop loss is specified:
PasswordTest
flat US500 q=2
For TradingView strategy:
PasswordTest
{{strategy.market_position}} BTCUSD q=0.06
Hence, it is able to automate trades with returning long, short, flat by setting up trading message as below: